import Mock from 'mockjs'
export default {
    getMenu: config => {
        const { username, password } = JSON.parse(config.body)
        if (username === 'admin' && password === '123456') {
            return {
                code: 200,
                data: {
                    token: Mock.Random.guid(),
                    message: '获取成功',
                    menuList: {
                        longTitle: '管理控制台',
                        littleTitle: '后台',
                        items: [
                            {
                                path: '/home',
                                name: 'home',
                                label: '首页',
                                icon: 'house',
                                url: 'home/HomeView',
                            },
                            {
                                path: '/mall',
                                name: 'mall',
                                label: '商品管理',
                                icon: 'Coffee',
                                url: 'mall/index',
                            },
                            {
                                path: '/user',
                                name: 'user',
                                label: "用户管理",
                                icon: "user",
                                url: "user/UserView"
                            },
                            {
                                label: "其他",
                                icon: "location",
                                children: [
                                    {
                                        path: "/page1",
                                        name: 'page1',
                                        label: "页面1",
                                        icon: "setting",
                                        url: "other/PageOne"
                                    },
                                    {
                                        path: "/page2",
                                        name: 'page2',
                                        label: "页面2",
                                        icon: "setting",
                                        url: "other/PageTwo"
                                    },
                                ]
                            },
                        ],
                    }
                }
            }
        } else {
            return {
                code: -999,
                data: { message: '用户名密码错误' }
            }
        }
    }

}